package com.lms.logistics_management_system.entity;

import cn.hutool.core.annotation.Alias;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.ToString;

import java.time.LocalDateTime;

//@data 是lombok中的插件能够默认写set和get所有东西
@Data
@NoArgsConstructor//自动创建无参构造
@AllArgsConstructor//自动创建有参构造
//mybatis-plus会直接去数据库中查找，名字必须一致或者用tablename
@TableName(value = "doctor")
@ToString
public class Doctor {

    @Alias("医生工号，主键,同时也是登录的账号")
    @TableId(type = IdType.AUTO)
    private Integer doctorId;
    //忽略密码不展示给前端
    @Alias("密码")
    private String doctorPassword;

    @Alias("姓名")
    private String doctorName;

    @Alias("邮箱")
    private String doctorEmail;

    @Alias("电话")
    private String doctorPhoneNumber;

    @Alias("科号")
    private Integer departmentId;

    @Alias("室号")
    private Integer roomId;

    @Alias("是否为管理员")
    private Integer doctorIsAdmin;

    //后端注册时获取不忽略
    @JsonProperty
    public void setPassword(final String doctorPassword) {
        this.doctorPassword = doctorPassword;
    }


}
